package com.jiang.daily.Q1287;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/02/17 1:36
 */
class Solution {
    public int findSpecialInteger(int[] arr) {
        int len = arr.length;
        int cnt = (int) (len * 0.25) + 1;
        int temp = 1;
        for (int i = 1; i < len; i++) {
            if (arr[i] == arr[i - 1]) {
                temp++;
            } else {
                temp = 1;
            }
            if (cnt == temp)
                return arr[i];
        }
        return arr[0];
    }
}
